<?php if($is_top == "S") : ?>
<?php javascript_include_tag('jflow.plus.js'); ?>

<div id="mySlides">
<?php $cont = 1; foreach ($ar as $banner): ?>
    <div id="slide<?php echo $cont;?>">    
        <?php 
        	echo image_tag(
				'/uploads/'.$banner['Midia'][0]['nm_midia'],
				array('border' => 0, 'alt' => $banner['Midia'][0]['ds_midia'], 'width' => '100%', 'height' => '235px')
			);
		?>
	</div>    	
<?php $cont++; endforeach;?>
</div>

<div id="myController">
	<?php for($i = 1; $i < $cont; $i++): ?>
   	<span class="jFlowControl"></span>
   	<?php endfor; ?>
</div>

<span class="jFlowPrev"><div></div></span>
<span class="jFlowNext"><div></div></span>

<script language="javascript">
	$(document).ready(function(){
	    $("#myController").jFlow({
			controller: ".jFlowControl", // must be class, use . sign
			slideWrapper : "#jFlowSlider", // must be id, use # sign
			slides: "#mySlides",  // the div where all your sliding divs are nested in
			selectedWrapper: "jFlowSelected",  // just pure text, no sign
			width: '1000px',
			height: '235px',  // this is the height for the content-slider
			duration: 400,  // time in miliseconds to transition one slide
			prev: ".jFlowPrev", // must be class, use . sign
			next: ".jFlowNext", // must be class, use . sign
			auto: true	
    });
});
</script>

<?php else: ?>

	<?php foreach($ar as $banner): ?>
	<div class="pt20 aproveite" style="text-align: right;">
		<span class="fr"><font color="#FFFFFF">Publicidade</font></span>
		<?php 
			echo link_to(
				image_tag(
					'/uploads/'.$banner['Midia'][0]['nm_midia'],
					array('border' => 0, 'alt' => $banner['Midia'][0]['ds_midia'], 'width' => '350px', 'height' => '250px')
				),
				$banner->ds_url,
				array('title' => $banner->nm_item)
			);
		?>
		<div class="clearB"></div>
	</div>
	<?php endforeach; ?>
<?php endif; ?>